/*
 * @Description: 系统权限操作字段，封装
 *  
 * @Date: 2021-03-04 17:27:08
 */
import Cookies from 'js-cookie';
import { ls, localStore } from './localStore';

const TokenKey = 'TOKEN';

export function getToken() {
  return ls.getItem('TOKEN');
}
export function setToken(v) {
  return ls.setItem('TOKEN', v, 7);
}
export function delToken() {
  return ls.removeItem('TOKEN');
}

export function isAdmin() {
  let userinfo = localStore.getUserInfo();
  let adminArr = ['admin'];
  return userinfo ? adminArr.includes(userinfo.username) : false; // 是否是gian
}
